package com.example.springbootsfzy.service.gengminghui;

import com.example.springbootsfzy.domain.CoursewareList;
import com.example.springbootsfzy.mapper.CoursewareListMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

@Service
public class CoursewareListService {

    @Autowired
    private CoursewareListMapper coursewareListMapper;

    //查询所有课程列表信息
    public List<CoursewareList> selectAll() {
        return coursewareListMapper.selectAll();
    }

    //删除课程列表信息
    public int deleteByPrimaryKey(Integer id) {
        return coursewareListMapper.deleteByPrimaryKey(id);
    }
    //添加课程列表信息
    public int insert(CoursewareList record) {
        return coursewareListMapper.insert(record);
    }

    //通过课程id查询列表信息
    public List<CoursewareList> selectByCourseId(Integer id) {
//        System.out.println(coursewareListMapper.selectByCourseId(id));

      return coursewareListMapper.selectByCourseId(id);
    }

    //修改课程列表信息
    public int updateByPrimaryKeySelective(CoursewareList record) {
        return coursewareListMapper.updateByPrimaryKeySelective(record);
    }





}
